﻿Imports System.Data.OleDb

Public Class frmLogin

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
        'If Me.txtUserName.Text = "Admin" And txtPassword.Text = "sourng" Then
        If checkUser(Me.txtUserName.Text, Me.txtPassword.Text) = True Then
            frmMain.Show()
            Me.Close()
        Else
            MsgBox("Please Enter User Name and Password again!", MsgBoxStyle.Information)
            Me.txtUserName.Text = ""
            Me.txtPassword.Text = ""
            Me.txtUserName.Focus()
        End If

    End Sub

    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
        Me.Close()
    End Sub

    Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Connect()

    End Sub
End Class
